﻿@model IEnumerable<MvcApplication2.Models.Sanpham>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            Loaisanpham
        </th>
        <th>
            Nhacungcap
        </th>
        <th>
            Tensanpham
        </th>
        <th>
            Gianhap
        </th>
        <th>
            Giaban
        </th>
        <th>
            Anhminhhoa
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Loaisanpham.Tenloaisp)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Nhacungcap.Tenhancungcap)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Tensanpham)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Gianhap)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Giaban)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Anhminhhoa)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.SanphamID }) |
            @Html.ActionLink("Details", "Details", new { id=item.SanphamID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.SanphamID })
        </td>
    </tr>
}

</table>
